#include"Heap.h"


void test()
{
	H h;
	int arr[] = { 1,54,23,44,11,75,12,43,56,51,29 };
	int n = sizeof(arr) / sizeof(arr[0]);
	HeapInit(&h,arr,n);

	//HeapPush(&h,2);
	//PrintHeap(&h);
	//PrintLikeTreeHeap(&h);

	HeapPush(&h, 88);
	PrintHeap(&h);

	PrintLikeTreeHeap(&h);

	HeapPush(&h,2);
	PrintHeap(&h);
	PrintLikeTreeHeap(&h);
	//1 11 2 43 29 12 23 44 56 51 54 88 75
	HeapPop(&h);
	PrintHeap(&h);
	PrintLikeTreeHeap(&h);
	//2 11 12 43 29 75 23 44 56 51 54 88
	int ret = HeapTop(&h);
	printf(" top = %d \n", ret);

	HeapDestroy(&h);
}

int main()
{
	test();

	return 0;
}